<template>
    <el-container style="height: 100%;">
        <el-aside width="17%" style="background-color: rgb(43, 46, 51);color:white">
            <div class="logo">
            <p style="color:#2DAFCB">HAPPY</p>
            <p>MMALL</p>
            </div>
            <el-menu default-active="2" class="el-menu-vertical-demo" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b">
                <el-submenu index="1">
                    <template slot="title">
                        <i class="el-icon-location"></i>
                        <span @click="commodity('/HomeRight')">首页</span>
                    </template>
                </el-submenu>
                <el-submenu index="2">
                    <template slot="title">
                        <i class="el-icon-menu"></i>
                        <span>商品</span>
                    </template>
                    <el-menu-item-group>
                        <el-menu-item index="1-1" @click="commodity('/Commodity')">商品管理</el-menu-item>
                        <el-menu-item index="1-2" @click="commodity('/Category')">品类管理</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>
                <el-submenu index="3">
                    <template slot="title">
                        <i class="el-icon-document"></i>
                        <span>订单</span>
                    </template>
                    <el-menu-item-group>
                        <el-menu-item index="1-1" @click="commodity('/Order')">订单管理</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>
                <el-submenu index="4">
                    <template slot="title">
                        <i class="el-icon-setting"></i>
                        <span>用户</span>
                    </template>
                    <el-menu-item-group>
                        <el-menu-item index="1-1" @click="commodity('/UserList')">用户列表</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>

                <el-submenu index="5">
                    <template slot="title">
                        <i class="el-icon-s-data"></i>
                        <span>图表</span>
                    </template>
                    <el-menu-item-group>
                        <el-menu-item index="1-1" @click="commodity('/echartsa')">echarts图表 柱状图</el-menu-item>
                        <el-menu-item index="1-2" @click="commodity('/echartsb')">echarts图表 折线图</el-menu-item>
                        <el-menu-item index="1-3" @click="commodity('/echartsc')">echarts图表 饼状图</el-menu-item>
                        <el-menu-item index="1-4" @click="commodity('/echartsd')">echarts图表 走势图</el-menu-item>
                        <el-menu-item index="1-4" @click="commodity('/baidu')">baidu 地图</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>
            </el-menu>
        </el-aside>

        <el-container>
            <el-header style="text-align: right; font-size: 12px; background:white;border-bottom:2px" >
                <el-dropdown class="div21"  @command="handleCommand">
                    <span style="font-size:16px;color:#333"> 
                        <i class="el-icon-user-solid"></i>
                        欢迎，admin
                        <i class="el-icon-caret-bottom"></i>
                    </span>
                    <el-dropdown-menu slot="dropdown">
                        <el-dropdown-item command="a">退出登录</el-dropdown-item>
                    </el-dropdown-menu>
                </el-dropdown>
            </el-header>
            <!-- <keep-alive> -->
                <router-view></router-view>
            <!-- </keep-alive> -->

            <!-- <keep-alive>
                <router-view :seller="seller" v-if="$route.meta.keepAlive"></router-view>
            </keep-alive>
            <router-view :seller="seller" v-if="!$route.meta.keepAlive"></router-view> -->
            
        </el-container>
    </el-container>
</template>
<script>
   export default {
        name:'Home',
        data() {
            return {
                
            };
        },
        methods:{
            commodity(str){
                this.$router.push(str)
            },
            handleCommand(command) {
                this.$router.push("/login");
            },
          
        },
        mounted(){

        },
   };
</script>
<style lang="scss" scoped>

@import "@/Scss/index.scss";
.div21>span{
    float: right;
    line-height: 4rem;
    margin-right: 3rem;
}
</style>